#!/bin/bash

# directory of this file
SCRIPT_DIR=$(dirname $(readlink -f $0))

# install directory
if [[ $INSTALL_DIR=="" ]] ; then
	INSTALL_DIR="$SCRIPT_DIR/.."
fi

# console output charset
# STDOUT_CHARSET=-Dfile.encoding=IBM866
# using default
STDOUT_CHARSET=""

# main class
MAIN_CLASS="tv.cofe.blogger.CLI"

# java interpreter
JAVA=java

# find jar files
CP=$(find "$INSTALL_DIR/lib" -type f -name '*.jar' | sort -n | tr "\n" ":")
CP=${CP%:}

# execute
"$JAVA" -cp "$CP" $STDOUT_CHARSET $MAIN_CLASS $*